<?php


namespace frontend\models\cyf;


use yii\db\ActiveRecord;

class CommendGoods extends ActiveRecord
{
    public static function tableName()
    {
        return '2008a_commend_goods';
    }

    /**
     * 查询推荐类商品
     * @return array|ActiveRecord[]
     * @name cyf
     */
    public static function getTypeID()
    {
       return self::find()->select(['commend_id'])
        ->groupBy('commend_id')
        ->asArray()
        ->all();
    }

    public static function getGoodsIDBytypeId($params)
    {
        return self::find()->select(['goods_id'])
            ->where('commend_id=:commend_id',[':commend_id'=>$params['commend_id']])
            ->asArray()
            ->all();
    }
}